<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <div class="container" :style="containerStyle" >
      <div id="stars" >
        <vue-particles
          color="#07ccff"
          :particleOpacity="0.7"
          :particlesNumber="80"
          shapeType="circle"
          :particleSize="4"
          linesColor="#47CD88"
          :linesWidth="1"
          :lineLinked="true"
          :lineOpacity="0.4"
          :linesDistance="150"
          :moveSpeed="3"
          :hoverEffect="true"
          hoverMode="grab"
          :clickEffect="true"
          clickMode="push"
          class="lizi"
        >
        </vue-particles>
      </div>
      <div class="top" >
        <div class="header">
          <a href="/">
            <span class="title">{{$t('loginTitle')}}</span>
          </a>
        </div>
      </div>

      <route-view ></route-view>

      <div class="footer">

        <div class="copyright">
          <p>{{$t('copyRightInfo')}}</p>
        </div>
      </div>

    </div>

  </div>
</template>

<script>
  import RouteView from "@/components/layouts/RouteView"
  import { mixinDevice } from '@/utils/mixin.js'

  export default {
    name: "UserLayout",
    components: { RouteView },
    mixins: [mixinDevice],
    data () {
      return {
        containerStyle:{
          backgroundImage:"url("+require("@/assets/loginbg.jpg")+")",
          backgroundRepeat: "no-repeat",
          backgroundSize: "100% 100%",
        },
        title:'',
        copyRightInfo:'',
      }

    },
    mounted () {
      document.body.classList.add('userLayout')
    },
    beforeDestroy () {
      document.body.classList.remove('userLayout')
    },
    created() {
      var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
      link.type = 'image/x-icon';
      link.rel = 'shortcut icon';
      link.href = require('@/assets/logo.png');
      document.getElementsByTagName('head')[0].appendChild(link);
    },
  }
</script>

<style lang="less" scoped>
  #userLayout.user-layout-wrapper {
    height: 100%;


    &.mobile {
      .container {
        .main {
          max-width: 368px;
          width: 98%;
        }
      }
    }


    .container {
      width: 100%;
      min-height: 100%;
      background-size: 100%;
      padding: 210px 0 0 0;
      position: absolute;


      #stars{
        position: absolute;
        width: 100%;
        height: 50%;
        top: 0;
        left: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background:linear-gradient(rgba(1,40,128,1.0),rgba(1,40,128,0))
         /*   background:linear-gradient(rgba(0,0,0,1),rgba(0,0,0,0));*/
      }
      a {
        text-decoration: none;
      }

      .top {
        text-align: center;

        .header {
          height: 44px;
          line-height: 44px;

          .badge {
            position: absolute;
            display: inline-block;
            line-height: 1;
            vertical-align: middle;
            margin-left: -12px;
            margin-top: -10px;
            opacity: 0.8;
          }

          .logo {
            height: 44px;
            vertical-align: top;
            margin-right: 16px;
            border-style: none;
          }

          .title {
            font-size: 50px;
            color: rgba(50, 155, 253, 1.0);
            font-family: "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
            font-weight: bold;
            position: relative;
            bottom: 70px;
            /*text-shadow: 2px -2px 3px #5a49fb;*/
            /*text-shadow: 0 -1px 0 #ccc, 0 -2px 0 #c9c9c9, 0 -3px 0 #bbb, 0 -4px 0 #b9b9b9, 0 -5px 0 #aaa,
                        0 -6px 1px rgba(0,0,0,0.1), 0 0 5px rgba(0,0,0,0.1),0 -1px 3px rgba(0,0,0,0.3),0 -3px 5px rgba(0,0,0,0.2),0 -5px 10px rgba(0,0,0,0.25);*/
            /*text-shadow:0 0 5px #CCCCCC, 0 0 10px #CCCCCC, 0 0 15px #CCCCCC, 0 0 20px #095816, 0 0 25px #095816, 0 0 30px #095816, 0 0 50px #095816, 0 0 80px #095816, 0 0 100px #095816, 0 0 150px #095816;*/
            color: #329bfd;
            letter-spacing: .15em;
            text-shadow:
                -1px -1px 1px #0a619f,
              0px 1px 0 #0a5d99,
              0px 2px 0 #084f82,
              0px 3px 0 #074978,
              0px 4px 0 #063a61,
              0px 5px 0 #06365a,
              0px 6px 0 #053253,
              0px 7px 0 #052844,
              0px 8px 0 #042d4b,
              0px 9px 0 #042844,
              0px 10px 0 #03243c,
              0px 11px 0 #031e33,
              0px 12px 0 #021b2d,
              0px 13px 0 #021626,
              0px 14px 0 #00060b,
              0px 15px 0 #000408,
              2px 20px 5px rgba(0, 0, 0, 0.9),
              5px 23px 5px rgba(0, 0, 0, 0.3),
              8px 27px 8px rgba(0, 0, 0, 0.5),
              8px 28px 35px rgba(0, 0, 0, 0.9);
            box-shadow: 0px 0px 100px 200px rgba(2,48,101,0.2) inset;
            height: 50px;
            line-height: 50px;
          }
        }
        .desc {
          font-size: 14px;
          color: rgba(0, 0, 0, 0.45);
          margin-top: 12px;
          margin-bottom: 40px;
        }
      }



      .footer {
        position: absolute;
        width: 100%;
        bottom: 0;
        padding: 0 16px;
        margin: 48px 0 24px;
        text-align: center;

        .links {
          margin-bottom: 8px;
          font-size: 14px;
          a {
            color: rgba(255, 255, 255, 1.0);
            transition: all 0.3s;
            &:not(:last-child) {
              margin-right: 40px;
            }
          }
        }
        .copyright {
          color: rgba(255, 255, 255, 0.6);
          font-size: 15px;
        }
      }


    }
  }
</style>